$(function() {
	$(".link-pay").click(function() {
		console.log($("#addressUid").val())
		var aid=$("#addressUid").val();
		console.log($("#selectTotal").html())
		var price=$("#selectTotal").html()-0
		var oid;
		$.ajax({
			url:"/order/addOrder?aid="+aid+"&price="+price,
			type:"post",
			dataType:"json",
			success:function (result) {
				if(result.state==2000){
					alert("下单成功");
					oid=result.data;

					$.ajax({
						url:"/orderItem/add?oid="+oid+"&arr="+arr,
						type:"get",
						dataType:"json",
						success:function (res) {
							if(res.state==2000){
								alert("item创建成功")
							}
						}
					})
					var price=$("#selectTotal").html()
					location.href = "payment.html?oid="+oid+"&price="+price;
				}
			}
		})



	})
})
$(function() {
	// $(".link-success").click(function() {
	// 	location.href = "paySuccess.html";
	// })
})